package com.seek.springevent.activemq;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTextMessage;

import javax.jms.*;

public class ActiveMQProducer {

    public static void main(String[] args) {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "admin", "tcp://localhost:61616");
//        try (Connection connection = connectionFactory.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);) {
//            Destination destination = session.createQueue("seek.fail");
//            MessageProducer producer = session.createProducer(destination);
//            TextMessage textMessage = new ActiveMQTextMessage();
//            textMessage.setText("seek will faild");
//            producer.send(textMessage);
////            session.commit();
//        } catch (JMSException e) {
//            e.printStackTrace();
//        }
    }
}
